package com.itheima.app.controller;

import com.itheima.app.manager.BaiduManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

@Controller
public class BaiduController {
    @Autowired
    private BaiduManager baiduManager;

    @PostMapping("/baidu/location")
    public ResponseEntity saveUpdateLocation(@RequestBody Map<String, String> map) {
        System.out.println("上报地理位置"+map);
        String longitude = map.get("longitude");
        String latitude = map.get("latitude");
        String addrStr = map.get("addrStr");
        return baiduManager.saveUpdateLocation(longitude,latitude,addrStr);

    }

}
